package tt.dz.scheduletask;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;

import java.lang.reflect.Method;

public class DzSimpleAsyncUncaughtExceptionHandler implements AsyncUncaughtExceptionHandler
{
	private Log log = LogFactory.getLog(DzSimpleAsyncUncaughtExceptionHandler.class);

	@Override
	public void handleUncaughtException(Throwable ex, Method method, Object... params)
	{
		log.error(String.format("Unexpected error occurred invoking async " + "method '%s'.", method), ex);
	}
}
